﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NUnitTestProjectPlayground
{
        public class Account
        {
            private float balance;
            private float minimumBalance;

            public void Deposit(float amount)
            {
                balance += amount;
            }

            public void Withdraw(float amount)
            {
                if(balance<amount)
                {
                    throw new InsufficientFundsException();
                }
                balance -= amount;
            }

            public void TransferFunds(Account destination, float amount)
            {
                if (balance - amount < minimumBalance)
                    throw new InsufficientFundsException();
                destination.Deposit(amount);
                Withdraw(amount);
            }

            public float Balance
            {
                get { return balance; }
            }
        }
}
